/**
 * 项目名称:
 *
 * @Author: 夏国倩
 * @Date: 2023/9/12 9:59
 * @Copyright
 */
package itSystemCase2;
//轿车类
public class Sedan extends Car{
    private String type; //型号

    public Sedan(String licenseplate, String brand, int dailyrent,String type) {
        super(licenseplate,brand,dailyrent);
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
/*
* 重写计算租金
* */
    @Override
    public float calRent(int days) {
        float price=this.getDailyrent()*days;
        if (days>7 && days<=30){
            //price =price*0.9f;
            price *=0.9f;
        }else if (days>30 && days<=150){
            price *=0.8f;
        }else if (days>150){
            price *=0.7f;
        }
        return price;
    }
}
